package com.dys.testtreemap03;

/**
 * @className: com.dys.testtreemap03.Student
 * @description: com.dys.testtreemap03
 * @author: pine cone
 * @version: v1.0.0
 * @createTime: 2024/08/08 下午10:45
 */
public class Student implements Comparable<Student> {

    private String name;
    private int age;
    private Double height;

    public Student(String name, int age, Double height) {
        this.name = name;
        this.age = age;
        this.height = height;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Double getHeight() {
        return height;
    }

    public void setHeight(Double height) {
        this.height = height;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", height=" + height +
                '}';
    }

    @Override
    public int compareTo(Student o) {
        return this.getAge() - o.getAge();
    }
}
